package com.gavindon.android.network

import com.gavindon.android.entity.*
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.*


/**
 * description:
 * Created by liNan on  2021/5/6 15:58
 */
interface XjdApiService {

    //推荐课程
    @GET(recommendList)
    suspend fun recommendList(): BaseResp<List<RecommendLstResp>>

    //最新课程
    @GET(newestList)
    suspend fun newestList(): BaseResp<List<RecommendLstResp>>

    //首页轮播图
    @GET(popularList)
    suspend fun sliderBanner(
        @Query("currentPage") currentPage: Int = 1,
        @Query("pageCount") pageCount: Int = 4
    ): BaseResp<List<HomeBannerResp>>

    //课程目录
    @GET(courseCatalogTree)
    suspend fun courseCatalogTree(@Query("courseId") type: String): BaseResp<List<VideoTreeResp>>

    //视频信息
    @GET(clientCourse)
    suspend fun clientCourse(@Query("lessonId") type: String): BaseResp<VideoDetail>

    //课程信息
    @GET(clientCourseDetail)
    suspend fun clientCourseDetail(@Query("courseId") type: String): BaseResp<CourseDetailResp>
//    //课程列表
//    @GET(courseCatalogTree)
//    suspend fun clientCourseClassLst(@Query("courseId") type: String): BaseResp<List<VideoTreeResp>>

    //课程信息 /* 模块类型----- courseType 1教育-2创新-3老人-4乡村振兴 */
    @GET(subjectTree)
    suspend fun subjectTree(@Query("courseType") type: Int): BaseResp<List<SmartLeftTreeResp>>

    @GET(subjectCourseList)
    suspend fun subjectCourseList(
        @Query("currentPage") currentPage: Int = 1,
        @Query("pageCount") type: Int = 20,
        @Query("subjectId") subjectId: String
    ): BaseResp<List<SmartEducationContentResp>>

    @POST(scanCode)
    suspend fun scanCode(): BaseResp<ScanCodeResp>

    @FormUrlEncoded
    @POST(userLogin)
    suspend fun userLogin(@Field("scanCode") name: String = ""): BaseResp<ScanCodeResp>

    @GET(loginUser)
    suspend fun loginUserInfo(): BaseResp<UserInfoResp>

    @FormUrlEncoded
    @POST(clientFavoriteAdd)
    suspend fun clientFavoriteAdd(@Field("courseId") id: String): BaseResp<String>

    @FormUrlEncoded
    @POST(clientFavoriteCancel)
    suspend fun clientFavoriteCancel(@Field("courseId") id: String): BaseResp<String>

    @FormUrlEncoded
    @POST(clientFavoriteStatus)
    suspend fun clientFavoriteStatus(@Field("courseId") id: String): BaseResp<Boolean>

    //我的收藏 0正常课程 1短视频
    @FormUrlEncoded
    @POST(clientFavoriteCourses)
    suspend fun clientFavoriteCourses(@Field("subjectType") subjectType: Int): BaseResp<List<CollectRecordResp>>

    //我的学习记录
    @GET(clientCourseRcd)
    suspend fun clientCourseRcd(): BaseResp<List<StudyRecordResp>>

    //查询当前课程进度
    @GET(clientCourseRcdById)
    suspend fun clientCourseRcdById(@Query("lessonId") lessonId: String): BaseResp<StudyRecordResp>

    //我的学习记录
    @FormUrlEncoded
    @POST(clientLessonProgress)
    suspend fun clientLessonProgress(
        @Field("lessonId") lessonId: String,
        @Field("watchedSecond") watchedSecond: Int
    ): BaseResp<String>

    //热门搜索标签
    @GET(searchFindHotVocabulary)
    suspend fun searchFindHotVocabulary(): BaseResp<List<HotTagResult>>

    //搜索排行
    @GET(searchFindHotCourse)
    suspend fun searchFindHotCourse(): BaseResp<List<SmartEducationContentResp>>

    //搜索结果
    @GET(clientCourseSearch)
    suspend fun clientCourseSearch(
        @Query("coursePinYin") coursePinYin: String,
        @Query("word") word: String,
    ): BaseResp<List<SearchResp>>

    //查询套餐列表
    @GET(comboLstByCourseId)
    suspend fun comboLstByCourseId(@Query("courseId") courseId: String): BaseResp<List<ComboResp>>

    //查询套餐信息
    @GET(comboLst)
    suspend fun comboLstInfo(@Query("packageId") packageId: String): BaseResp<ComboResp>

    @GET(generateOrderId)
    suspend fun generateOrderId(
        //商品类型0课程1套餐
        @Query("itemType") itemType: String,
        //套餐Id
        @Query("packageOrCourseId") packageOrCourseId: String,
        //支付类型0微信1支付宝
        @Query("payType") payType: String,
        @Query("sourceType") sourceType: String = "tv",
    ): BaseResp<OrderInfoResp>

    @GET(aliPay)
    suspend fun aliPcPay(
        @Query("orderId") orderId: String,
    ): BaseResp<String>

    @GET(wxPay)
    suspend fun wxPcPay(
        @Query("orderId") orderId: String,
    ): BaseResp<String>

    @GET(queryIsPay)
    suspend fun checkIsPay(
        @Query("orderId") orderId: String,
    ): BaseResp<PayResultResp>

    @GET(findOrder)
    suspend fun findOrder(
        @Query("orderType") orderId: String,
        @Query("packageOrCourseId") packageOrCourseId: String,
        //查询支付成功的
        @Query("payStatus") payStatus: Int = 1,
    ): BaseResp<List<CheckCanLookResp>>

    @GET(myCourseOrPackage)
    suspend fun myCourseOrPackage(
        //0：课程 1：套餐
        @Query("courseType") courseType: Int,
    ): BaseResp<List<CheckCanLookResp>>
/*
    */
    /**
     * 通迅录请求,传code获取部门下的子数据
     *//*
    @FormUrlEncoded
    @POST(contactUrl)
    suspend fun contact(@Field("name") name: String = ""): BaseResp<ContactResp>


    @FormUrlEncoded
    @POST(searchGroup)
    suspend fun searchContact(@Field("name") name: String): BaseResp<List<SearchData>>

    *//*根据姓名查询审核人列表*//*
    @FormUrlEncoded
    @POST(reviewQueryByName)
    suspend fun reviewContactPeople(
        @Field("name") name: String = ""
    ): BaseResp<List<SearchData>>

    *//*常用联系人 传R获取审核人的常用联系人*//*
    @GET(topContacts)
    suspend fun topContacts(@Query("askType") askType: String = ""): BaseResp<List<Teacher>>

    @FormUrlEncoded
    @POST(contactUrl)
    suspend fun contactPeople(@Field("code") code: String = ""): BaseResp<ContactResp>

    *//*审核人目录*//*
    @FormUrlEncoded
    @POST(reviewOrgGroup)
    suspend fun contactReview(
        @Field("name") name: String = "",
        @Field("code") code: String = ""
    ): BaseResp<ContactResp>


    //预约会议
    @FormUrlEncoded
    @POST(createMeeting)
    suspend fun bookMeeting(@FieldMap map: HashMap<String, Any?>): BaseResp<BookMeetingResp>



    @GET(jdPlatformType)
    suspend fun jdPlatformType(): BaseResp<List<PlatformResp>>

    //加入会议(平台)
    @FormUrlEncoded
    @POST(joinMeeting)
    suspend fun joinMeetingPlatform(@Field("meetingCode") meetingCode: String = ""): BaseResp<List<Meeting>>


    //| dataIndicator会议列表，历史会议 | 1:现实记录  -1:历史记录 | NO | 不传值的话，获取所有记录 |
    //dataIndicator 0.未开始  1.进行中  2. 已结束  3.已取消
    //pageCount每页数量，pageSize页数
    @GET(confLst)
    suspend fun confLst(
        @Query("dataIndicator") type: String,
        @Query("currentPage") currentPage: Int,
        @Query("pageCount") pageCount: Int
    ): BaseResp<List<MeetingLstResp>>

    //auditStatus 待审核会议 | 审核状态 0：未审核  1：审核通过 -1：审核未通过 -2:取消 | NO | 不传值的话，获取审核通过的，可以传多个，以逗号分隔 例如0,1,-1 |
    @GET(confLst)
    suspend fun todoReviewLst(
        @Query("auditStatus") type: String = "0,-1",
        @Query("createUserId") id: String = UserInfoBean.userId ?: ""
    ): BaseResp<List<MeetingLstResp>>

    @FormUrlEncoded
    @POST(meetingDetailById)
    suspend fun meetingDetailById(@Field("meetingId") id: String): BaseResp<Meeting>

    //取消会议
    @FormUrlEncoded
    @POST(cancelMeeting)
    suspend fun cancelMeeting(
        @Field("meetingId") id: String,
        @Field("platform") platform: String
    ): BaseResp<Any>

    //鉴权
    @FormUrlEncoded
    @POST(authInfo)
    suspend fun authInfo(@Field("platform") platform: String): BaseResp<AuthInfoBean>

    //记录会议信息
    @FormUrlEncoded
    @POST(recordJoinMeeting)
    suspend fun recordMeeting(@FieldMap map: HashMap<String, String?>): BaseResp<String>

    //token请求
    @GET(tokenVerify)
    suspend fun tokenVerify(): BaseResp<String>

    //发送短信
    @FormUrlEncoded
    @POST(inMeetingSendSms)
    suspend fun sendMsg(
        @Field("meetingCode") code: String = "",
        @Field("intReceivers") invites: String,
        @Field("platform") platform: String
    ): BaseResp<SendSmsResp>

    //会议录制查看权限
    @GET(cloudMeetingFilePermission)
    suspend fun meetingFilePermission(@Query("userId") userId: String): BaseResp<LookRecordPermissionResp>

    @Streaming
    @GET
    fun download(@Url url: String?): Observable<ResponseBody?>?*/
}